package com.chinasoft.mall.model.response;

import android.util.Log;


public class BaseResponse {
	int json_type=1;
	private BaseResponse br;
	 //返回数据
	private Object data;
	public BaseResponse(String url)
	{
		if(url!=null){
			try {
				br=(BaseResponse) getBeanClass(url).newInstance();
			} catch (IllegalAccessException e) {
				e.printStackTrace();
			} catch (InstantiationException e) {
				e.printStackTrace();
			}
		}
	}
	public BaseResponse(){
	}
	/**
	 * json 返回类型   默认 为List
	 * return Object ：0  List : 1   List<String> 2
	 */
	public int getJsonType(){
		if(br!=null){
			if(br.getJsonType()!=json_type){
				return br.getJsonType();
			}
		}
		return json_type;
	}
	//解析数据Clazz
	public Class<?> getBeanClass(String urlkey) {
		try {
			return Class.forName(urlkey);
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
			return null;
		}
	}
	//获取数据
	public Object getData(){
		return data;
	}
	//插入数据
	public void setData(Object data){
		this.data=data;
	}
	
}
